import React, { Component } from 'react'
import { Route, NavLink, Switch, Redirect } from 'react-router-dom'
import Hardware from './Hardware'
import Hammer from './Hammer'
import Clothes from './Clothes'
import Breath from './Breath'
import Medical from './Medical'

export default class Category extends Component {
  render() {
    return (
      <div>
        分类
        <NavLink to='/Category/hardware'>硬件</NavLink>
        <NavLink to='/Category/hammer'>锤子</NavLink>
        <NavLink to='/Category/clothes'>衣服</NavLink>
        <NavLink to='/Category/breath'>呼吸</NavLink>
        <NavLink to='/Category/medical'>医疗</NavLink>

        <Switch>
          <Route path="/Category/hardware" component={Hardware} />
          <Route path="/Category/hammer" component={Hammer} />
          <Route path="/Category/clothes" component={Clothes} />
          <Route path="/Category/breath" component={Breath} />
          <Route path="/Category/medical" component={Medical} />
          <Redirect from="/Category" to="Category/hardware" exact />
        </Switch>
      </div>
    )
  }
}
